package com.ask.order.feign;

import com.ask.constants.ServiceConstants;
import com.ask.order.feign.fallback.ProductFeignClientFallback;
import com.ask.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;


@FeignClient(value = ServiceConstants.PRODUCT_SERVICE, fallback = ProductFeignClientFallback.class)
public interface ProductFeignClient {
    @GetMapping("/api/product/product/{id}") // 发送get请求
    Product getProductById(@PathVariable("id") Long id);
}
